<template>
  <view class="container">
    <z-paging-swiper>
      <z-paging
        ref="paging"
        v-model="itemList"
        @query="queryList"
        :fixed="true"
        :auto="false"
        empty-view-text="暂时还没有数据咯~"
        :empty-view-img="`${getImageUrl('empty.png')} `"
        :empty-view-img-style="imgStyle"
      >
        <view slot="top">
          <u-navbar height="50" :title="title" title-size="36" title-color="#333"></u-navbar>
        </view>
        <view class="goodsItemView">
          <view class="itemView" v-for="(item, index1) in itemList" :key="index1">
            <view class="content dis-flex flex-y-between">
              <view class="user-box dis-flex flex-y-center">
                <u-avatar :src="item.user.avatar" size="80"></u-avatar>
                <view class="info">
                  <view class="tel">{{ item.user.mobile }}</view>
                  <view class="type">{{ item.user.nickname }}</view>
                </view>
              </view>
              <view class="type">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM') }}</view>
            </view>
          </view>
        </view>
      </z-paging>
    </z-paging-swiper>
  </view>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      imgStyle: {
        width: '12rem'
      },
      show: false,
      current: 0,
      scurrent: 0,
      resStatus: '',
      tabsList: [],
      itemList: [],
      valid: '',
      title: ''
    }
  },
  onLoad(res) {
    this.current = Number(res.index) ? Number(res.index) : 0
    this.scurrent = Number(res.index) ? Number(res.index) : 0
    this.valid = res.valid !== 'false'
    this.title = this.valid ? '推广总会员' : '推广无效会员'
  },
  onShow() {
    this.queryList()
  },
  methods: {
    queryList(pageNo = 1, pageSize = 10) {
      this.$u
        .get('/app-api/brokerage/user/page-vip', {
          pageNo,
          pageSize,
          valid: this.valid
        })
        .then((res) => {
          this.$refs.paging.complete(res.data.list)
        })
    }
  }
}
</script>

<style lang="scss" scoped>
page {
  height: 100%;
  background: #f0f1f2;
}

.goodsItemView {
  padding: 0 20rpx;
}

.count-team {
  width: 710rpx;
  height: 80rpx;
  background: #ffffff;
  border-radius: 10rpx;
  margin: auto;
  padding: 20rpx;
  color: #666666;

  .bold {
    font-size: 30rpx;
    color: #333333;
    padding: 0 4rpx;
    font-weight: 600;
  }
}

.itemView {
  background: #ffffff;
  border-radius: 10rpx;
  padding: 30rpx 20rpx;
  margin-top: 20rpx;

  .info {
    margin-left: 18rpx;
    height: 100%;
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }

  .rightView {
    text-align: right;
    height: 80rpx;
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }

  .type {
    font-size: 20rpx;
    color: #999999;
  }

  .share-user {
    font-size: 24rpx;
    color: #fa453c;
    padding: 10rpx 0 0 98rpx;
  }
}
</style>
